/*
 *
 * SimplePCR1000 (Qt4) Version 1.0.x
 * Copyright (C) 2011  Tyler H. Jones (me@tylerjones.me)
 * http://sourceforge.net/p/simplepcr1000/
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */


#ifndef SETTINGSDIALOG_H
#define SETTINGSDIALOG_H

#include "common.h"
#include "appsettings.h"
#include "database.h"

namespace Ui {
    class SettingsDialog;
}

class SettingsDialog : public QDialog
{
    Q_OBJECT
    Q_DISABLE_COPY(SettingsDialog)
    
public:
    explicit SettingsDialog(QWidget *parent = 0, Database *ParentDB = 0);
    virtual ~SettingsDialog();
    
private:
    Ui::SettingsDialog *ui;
    //Declare object libraries
    Common COM; //Common varialbes/opertions class declaration
    AppSettings SET; //Application settings object
    Database *DB; //SQLite database object    //Declare functions
    QPushButton *btnCancel;
    QPushButton *btnOK;
    QPushButton *btnRestoreDefaults;
    void createActions();
    void LoadSettings();
    void SaveSettings();
    void setupDatabaseTab();
    void setupGeneralTab();
    void setupAdvancedTab();
    void setupConnectionTab();

signals:
    void ReapplyConfig();

protected slots:
    //Declare Button slots
    void changedSelectedPort(QString);
    void clickRestoreDefaluts();
    void clickCancel();
    void clickOK();
    void clickTestPort();
    void clickResetDB();
    void clickBackupDB();
    void clickRestoreDB();
};

#endif // SETTINGSDIALOG_H
